import java.util.Arrays;
public class Test {
    public static String mytoString(int[] arr) {
        if(arr == null) {
            return "null";
        }
        if(arr.length == 0) {
            return "[]";
        }
        String ret = "[";
        for (int i = 0; i < arr.length; i++) {
            ret = ret + arr[i];
            if(i == arr.length-1) {
                break;
            }
            ret = ret + ',';
        }
        ret+=']';
        return ret;
    }
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        String ret = mytoString(arr);
        System.out.println(ret);

    }
}
